<template>
  <view class="productItem" :data-prodid="item.prodId" @tap="onProductInfo">
    <view class="pic">
      <image class="img" :src="item.pic" />
    </view>
    <view class="info">
      <view class="goodsName">{{ item.prodName }}</view>
      <view class="describe">{{ item.brief ? item.brief : '--' }}</view>
      <!-- <view v-if="sts === 6" class="comment">{{ item.prodCommNumber }}评价 {{ item.positiveRating }}%好评</view> -->
      <view class="priceInfo">
        <view class="price">
          <!-- <text v-if="sts === 2" class="deadline-price">限时价</text> -->
          <text class="symbol">￥</text>
          <text class="big-num">{{ wxs.parsePrice(item.price)[0] }}</text>
          <text class="small-num">.{{ wxs.parsePrice(item.price)[1] }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
const wxs = number();
// eslint-disable-next-line no-unused-vars
const props = defineProps({
  item: {
    type: Object,
    default: () => {
      return null;
    }
  },
  sts: {
    type: Number,
    default: () => {
      return 2;
    }
  }
});

const onProductInfo = (e) => {
  const productId = e.currentTarget.dataset.prodid;
  uni.navigateTo({
    url: '/pages/index/productInfo/productInfo?productId=' + productId
  });
};
</script>

<style scoped lang="scss">
@import './production.scss';
</style>
